package com.xhl.consul.tool;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;

@SpringBootApplication
@Slf4j
@ComponentScan(basePackages = {"com.commons.tools.**",
        "com.xhl.consul.tool"})
//@EnableDiscoveryClient
public class ConsulToolApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ConsulToolApplication.class, args);
    }

    @PostConstruct
    @Transactional
    public void init() {
        log.info(" -------------- 初始化完成之后执行 init... -------------- ");
    }

}
